﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QuanLyThongTinNhanKhau.model.DAO
{
    class TKTamTruDAO
    {
        SQLServiceDAO service = new SQLServiceDAO();

        internal DataTable btnThongKe(string fromDate, string toDate)
        {
            String sql = "select MaTamTru, t.MaNhanKhau, HoTen, NgaySinh, NoiThuongTru, NgayTamTru, NoiDangKiTamTru, Case When t.TinhTrang = 'Enable' then N'Mở' Else N'Đóng' End as TinhTrang from NHANKHAU n join TAMTRU t on n.MaNhanKhau = t.MaNhanKhau where NgayTamTru >= '" + fromDate + "' and NgayTamTru <= '" + toDate + "'";
            return service.getDataTable(sql);
        }
    }
}
